﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MenuManager.aspx.cs" Inherits="GPSTrackingWebsiteManager.Manager.Pages.MenuManager" %>

<!DOCTYPE html>

<link href="../../Css/GPSTrackingWebsite.css" rel="stylesheet" />
<link href="../../Css/messi.css" rel="stylesheet" />
<script src="../../Javascript/jquery-1.11.1.min.js"></script>
<script src="../../Javascript/messi.js"></script>
<script src="../../Javascript/Custom.js"></script>
<script src="../../Javascript/WindowMessageManager.js"></script>

<html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Administrador de Pantallas</title>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">

                function resizeGrid() {
                    var height = (window.innerHeight) - 25;
                    var tableView = $find("<%=MenuParentsGrid.ClientID %>");
                    tableView.get_element().style.height = (height) / 2 + "px";

                    var tableView2 = $find("<%=MenuDetailGrid.ClientID %>");
                    tableView2.get_element().style.height = (height - (height) / 2) + "px";

                    document.getElementById('HiddenFieldHeight').value = (height);
                }

                var uploadedFilesCount = 0;
                var isEditMode;
                function validateRadUpload(source, e) {
                    // When the RadGrid is in Edit mode the user is not obliged to upload file.
                    if (isEditMode == null || isEditMode == undefined) {
                        e.IsValid = false;

                        if (uploadedFilesCount > 0) {
                            e.IsValid = true;
                        }
                    }
                    isEditMode = null;
                }

                function OnClientFileUploaded(sender, eventArgs) {
                    uploadedFilesCount++;
                }

                //Windows Message Manager 
                var objWindowsMessageManager = new WindowsMessageManager();
            </script>
        </telerik:RadScriptBlock>
    </head>

    <body onresize="resizeGrid()" style="overflow: hidden">
        <form id="form1" runat="server">
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
                <ajaxsettings>
                    <telerik:AjaxSetting AjaxControlID="MenuParentsGrid">
                        <updatedcontrols>
                            <telerik:AjaxUpdatedControl ControlID="HiddenFieldHeight" UpdatePanelCssClass="" />
                            <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" UpdatePanelCssClass="" />
                            <telerik:AjaxUpdatedControl ControlID="rmpMenu" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        </updatedcontrols>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="MenuDetailGrid">
                        <updatedcontrols>
                            <telerik:AjaxUpdatedControl ControlID="HiddenFieldHeight" UpdatePanelCssClass="" />
                            <telerik:AjaxUpdatedControl ControlID="HiddenFieldError" UpdatePanelCssClass="" />
                            <telerik:AjaxUpdatedControl ControlID="rmpMenu" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                        </updatedcontrols>
                    </telerik:AjaxSetting>
                </ajaxsettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
            
            <asp:HiddenField ID="HiddenFieldHeight" runat="server" Value="323" />
            <asp:HiddenField ID="HiddenFieldError" runat="server" Value="" />

            <telerik:RadTabStrip ID="rtsMenu" runat="server" SelectedIndex="0" MultiPageID="rmpMenu" ></telerik:RadTabStrip>
            <telerik:RadMultiPage ID="rmpMenu" runat="server" SelectedIndex="0">
            <telerik:RadPageView ID="rpvMenu" runat="server">

                <telerik:RadGrid ID="MenuParentsGrid" runat="server" AutoGenerateColumns="False" GroupingSettings-CaseSensitive="false" CellSpacing="0" GridLines="None" Height="200px" Width="100%" AllowFilteringByColumn="True" AllowSorting="True" OnNeedDataSource="MenuParentsGrid_NeedDataSource" OnSelectedIndexChanged="MenuParentsGrid_SelectedIndexChanged" OnDeleteCommand="MenuParentsGrid_DeleteCommand" OnInsertCommand="MenuParentsGrid_InsertCommand" OnUpdateCommand="MenuParentsGrid_UpdateCommand" OnRowDrop="MenuParentsGrid_RowDrop">
                    <MasterTableView EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true" EditFormSettings-CaptionFormatString="Modo Edición" CommandItemDisplay="TopAndBottom" NoMasterRecordsText="No hay registros" AllowFilteringByColumn="true" TableLayout="Auto">
                        <CommandItemTemplate>
                            <div style="padding: 5px 5px;">
                                Menu:
                                <asp:LinkButton ID="lbAdd" runat="server" CommandName="InitInsert" Visible='<%# !MenuParentsGrid.MasterTableView.IsItemInserted %>'>
                                    <img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/text-plus-icon.png"/>Nuevo Menu
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbClearMenuItemsFilters" runat="server" OnClick="lbClearMenuFilters_Click"  Visible='<%# !MenuParentsGrid.MasterTableView.IsItemInserted %>'>
                                    <img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/mixx-icon.png"/>Limpiar Filtros
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbShowError" runat="server" OnClick="lbShowError_Click" Visible='<%# HiddenFieldError.Value == string.Empty ? false : true %>'>
                                    <img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/bug-icon.png"/>Error Técnico
                                </asp:LinkButton>
                            </div>
                        </CommandItemTemplate>

                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>

                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>

                        <Columns>
                            <telerik:GridDragDropColumn HeaderStyle-Width="18px"></telerik:GridDragDropColumn>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="25px" EditText="Editar" ItemStyle-Width="20px">
                                <HeaderStyle Width="25px"></HeaderStyle>

                                <ItemStyle Width="20px"></ItemStyle>
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn HeaderStyle-Width="25px" ConfirmText="¿Desea eliminar el registro?" ConfirmDialogType="RadWindow" ConfirmDialogHeight="120" ConfirmDialogWidth="270" ConfirmTitle="Eliminar" ButtonType="ImageButton" CommandName="Delete" Text="Eliminar" ItemStyle-Width="20px" >
                                <HeaderStyle Width="25px"></HeaderStyle>

                                <ItemStyle Width="20px"></ItemStyle>
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn DataField="MenuId" HeaderText="MenuId" UniqueName="MenuId" Display="false" ForceExtractValue="Always" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="BySequence" HeaderText="BySequence" UniqueName="BySequence" Display="false" ForceExtractValue="Always" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Parent" HeaderText="Parent" UniqueName="Parent" Display="false" ForceExtractValue="Always" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Nombre" UniqueName="Name" 
                                                     FilterControlWidth="100px" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="130px" AutoPostBackOnFilter="true">
                                 <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                        <RequiredFieldValidator ForeColor="Red" ErrorMessage="* Requerido" SetFocusOnError="true"></RequiredFieldValidator>
                                    </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ToolTip" HeaderText="Tooltip" UniqueName="ToolTip" 
                                                     FilterControlWidth="100px" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="200px" AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Page" HeaderText="Fuente" UniqueName="Page"
                                                     FilterControlWidth="100px" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="130px" AutoPostBackOnFilter="true">                            
                            </telerik:GridBoundColumn>
                            <telerik:GridCheckBoxColumn DataField="IsVisibleMaster" HeaderText="Master" UniqueName="IsVisibleMaster" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                                        AllowFiltering="false">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsVisibleAdministrator" HeaderText="Admin" UniqueName="IsVisibleAdministrator" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                                        AllowFiltering="false">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsVisibleUser" HeaderText="Usuario" UniqueName="IsVisibleUser" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                                        AllowFiltering="false">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridTemplateColumn HeaderText="Imagen" UniqueName="ImageUrl" DataField="ImageUrl" ForceExtractValue="Always" AllowFiltering="false" HeaderStyle-Width="50px">
                                <ItemTemplate>
                                    <asp:Image ID="ImageOriginal" ImageUrl='<%# "../../Template/Icons/16px/"+Eval("ImageUrl") %>' runat="server" AlternateText='<%# Eval("ImageUrl") + " 16px, 16px" %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadAsyncUpload ID="RadUpload1" ToolTip='<%# Eval("ImageUrl") %>' InitialFileInputsCount="1" Localization-Select="Buscar" OverwriteExistingFiles="true" ControlObjectsVisibility="None" runat="server" 
                                                            OnClientFileUploaded="OnClientFileUploaded"  AllowedFileExtensions="jpg,png"></telerik:RadAsyncUpload>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridNumericColumn DataField="Width"  DecimalDigits="0" FilterControlAltText="Filter Width column" HeaderText="Ancho px" UniqueName="Width" AllowFiltering="false">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="Heigth" DecimalDigits="0" FilterControlAltText="Filter Heigth column" HeaderText="Alto px" UniqueName="Heigth" AllowFiltering="false">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="Positionx" DecimalDigits="0"  HeaderText="Posición X px" UniqueName="Positionx" AllowFiltering="false">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="Positiony" DecimalDigits="0" FilterControlAltText="Filter PositionY column" HeaderText="Position Y px" UniqueName="Positiony" AllowFiltering="false">
                            </telerik:GridNumericColumn>                       
                            <telerik:GridDropDownColumn DataField="MenuTypeId" DataSourceID="sdsMenuType"  HeaderText="Tipo" ListTextField="Name" ListValueField="MenuTypeId" UniqueName="MenuTypeId" HeaderStyle-Width-="120px">
                                  <FilterTemplate>
                                    <telerik:RadComboBox ID="cmbMenuType" DataSourceID="sdsMenuType" DataTextField="Name" DataValueField="MenuTypeId"  Width="100px"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("MenuTypeId").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="MenuTypeIdIndexChanged" Sort="Ascending">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="Todos" Value=""/>
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
                                        <script type="text/javascript">
                                            function MenuTypeIdIndexChanged(sender, args) {
                                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                tableView.filter("MenuTypeId", args.get_item().get_value(), "EqualTo");
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>
                                      </FilterTemplate>
                            </telerik:GridDropDownColumn>
                            <telerik:GridDropDownColumn DataField="TypeModuleId" DataSourceID="sdsTypeModule" HeaderText="Módulo" ListTextField="Name" ListValueField="TypeModuleId" UniqueName="TypeModuleId" HeaderStyle-Width-="120px">
                                  <FilterTemplate>
                                    <telerik:RadComboBox ID="cmbTypeModule" DataSourceID="sdsTypeModule" DataTextField="Name" DataValueField="TypeModuleId"  Width="100px"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("TypeModuleId").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="TypeModuleIdIndexChanged" Sort="Ascending">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="Todos" Value=""/>
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                        <script type="text/javascript">
                                            function TypeModuleIdIndexChanged(sender, args) {
                                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                tableView.filter("TypeModuleId", args.get_item().get_value(), "EqualTo");
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>
                                      </FilterTemplate>
                            </telerik:GridDropDownColumn>

                        </Columns>

                        <EditFormSettings>
                            <EditColumn InsertText="Agregar" UpdateText="Actualizar" CancelText="Cancelar" ButtonType="ImageButton"></EditColumn>

                            <PopUpSettings Modal="True"></PopUpSettings>
                        </EditFormSettings>

                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    </MasterTableView>

                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    <ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true" EnablePostBackOnRowClick="true">                   
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                        </Scrolling>
                        <Selecting AllowRowSelect="True"></Selecting>
                        <ClientEvents OnPopUpShowing="PopUpShowing" />
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                </telerik:RadGrid>
                <br />
                <telerik:RadGrid ID="MenuDetailGrid" runat="server" AutoGenerateColumns="False" GroupingSettings-CaseSensitive="false" CellSpacing="0" GridLines="None" Height="200px" Width="100%" AllowFilteringByColumn="True" AllowSorting="True" OnNeedDataSource="MenuDetailGrid_NeedDataSource" OnDeleteCommand="MenuDetailGrid_DeleteCommand" OnInsertCommand="MenuDetailGrid_InsertCommand" OnUpdateCommand="MenuDetailGrid_UpdateCommand" OnRowDrop="MenuDetailGrid_RowDrop">
                    <MasterTableView EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true" EditFormSettings-CaptionFormatString="Modo Edición" CommandItemDisplay="TopAndBottom" NoMasterRecordsText="No hay registros" AllowFilteringByColumn="true" TableLayout="Auto">
                        <CommandItemTemplate>
                            <div style="padding: 5px 5px;">
                                Menu:
                                <asp:LinkButton ID="lbAdd" runat="server" CommandName="InitInsert" Visible='<%# !MenuDetailGrid.MasterTableView.IsItemInserted %>'>
                                    <img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/text-plus-icon.png"/>Nuevo Submenu
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbClearMenuDetailItemsFilters" runat="server" OnClick="lbClearMenuDetailItemsFilters_Click"  Visible='<%# !MenuDetailGrid.MasterTableView.IsItemInserted %>'>
                                    <img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/mixx-icon.png"/>Limpiar Filtros
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbShowError" runat="server" OnClick="lbShowError_Click" Visible='<%# HiddenFieldError.Value == string.Empty ? false : true %>'>
                                    <img style="padding-left:10px; padding-right:5px; vertical-align:middle" alt="" src="../../Template/Icons/16px/bug-icon.png"/>Error Técnico
                                </asp:LinkButton>
                            </div>
                        </CommandItemTemplate>

                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>

                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>

                        <Columns>
                              <telerik:GridDragDropColumn HeaderStyle-Width="18px">
                            </telerik:GridDragDropColumn>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="25px" EditText="Editar" ItemStyle-Width="20px">
                                <HeaderStyle Width="25px"></HeaderStyle>

                                <ItemStyle Width="20px"></ItemStyle>
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn HeaderStyle-Width="25px" ConfirmText="¿Desea eliminar el registro?" ConfirmDialogType="RadWindow" ConfirmDialogHeight="120" ConfirmDialogWidth="270" ConfirmTitle="Eliminar" ButtonType="ImageButton" CommandName="Delete" Text="Eliminar" ItemStyle-Width="20px" >
                                <HeaderStyle Width="25px"></HeaderStyle>

                                <ItemStyle Width="20px"></ItemStyle>
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn DataField="MenuId" HeaderText="MenuId" UniqueName="MenuId" Display="false" ForceExtractValue="Always" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="BySequence" HeaderText="BySequence" UniqueName="BySequence" Display="false" ForceExtractValue="Always" ReadOnly="true">
                            </telerik:GridBoundColumn>
                             <telerik:GridBoundColumn DataField="Parent" HeaderText="Parent" UniqueName="Parent" Display="false" ForceExtractValue="Always" ReadOnly="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Nombre" UniqueName="Name" 
                                                     FilterControlWidth="100px" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="130px" AutoPostBackOnFilter="true">
                                 <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                        <RequiredFieldValidator ForeColor="Red" ErrorMessage="* Requerido" SetFocusOnError="true"></RequiredFieldValidator>
                                    </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ToolTip" HeaderText="Tooltip" UniqueName="ToolTip" 
                                                     FilterControlWidth="100px" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="200px" AutoPostBackOnFilter="true">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Page" HeaderText="Fuente" UniqueName="Page"
                                                     FilterControlWidth="100px" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="130px" AutoPostBackOnFilter="true">
                                  <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                        <RequiredFieldValidator ForeColor="Red" ErrorMessage="* Requerido" SetFocusOnError="true"></RequiredFieldValidator>
                                    </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridCheckBoxColumn DataField="IsVisibleMaster" HeaderText="Master" UniqueName="IsVisibleMaster" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                                        AllowFiltering="false">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsVisibleAdministrator" HeaderText="Admin" UniqueName="IsVisibleAdministrator" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                                        AllowFiltering="false">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridCheckBoxColumn DataField="IsVisibleUser" HeaderText="Usuario" UniqueName="IsVisibleUser" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                                        AllowFiltering="false">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridTemplateColumn HeaderText="Imagen" UniqueName="ImageUrl" DataField="ImageUrl" ForceExtractValue="Always" AllowFiltering="false" HeaderStyle-Width="50px">
                                <ItemTemplate>
                                    <asp:Image ID="Image1" ImageUrl='<%# "../../Template/Icons/16px/"+Eval("ImageUrl") %>' runat="server" AlternateText='<%# Eval("ImageUrl") + " 16px, 16px" %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadAsyncUpload ID="RadAsyncUpload1" ToolTip='<%# Eval("ImageUrl") %>' InitialFileInputsCount="1" Localization-Select="Buscar" OverwriteExistingFiles="true" ControlObjectsVisibility="None" runat="server" 
                                                            OnClientFileUploaded="OnClientFileUploaded"  AllowedFileExtensions="jpg,png"></telerik:RadAsyncUpload>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridNumericColumn DataField="Width"  DecimalDigits="0" FilterControlAltText="Filter Width column" HeaderText="Ancho px" UniqueName="Width" AllowFiltering="false">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="Heigth" DecimalDigits="0" FilterControlAltText="Filter Heigth column" HeaderText="Alto px" UniqueName="Heigth" AllowFiltering="false">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="Positionx" DecimalDigits="0"  HeaderText="Posición X px" UniqueName="Positionx" AllowFiltering="false">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DataField="Positiony" DecimalDigits="0" FilterControlAltText="Filter PositionY column" HeaderText="Position Y px" UniqueName="Positiony" AllowFiltering="false">
                            </telerik:GridNumericColumn>
                            <telerik:GridDropDownColumn DataField="MenuTypeId" DataSourceID="sdsMenuType"  HeaderText="Tipo" ListTextField="Name" ListValueField="MenuTypeId" UniqueName="MenuTypeId" HeaderStyle-Width-="120px">
                                  <FilterTemplate>
                                    <telerik:RadComboBox ID="cmbMenuType" DataSourceID="sdsMenuType" DataTextField="Name" DataValueField="MenuTypeId"  Width="100px"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("MenuTypeId").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="MenuTypeIdIndexChanged" Sort="Ascending">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="Todos" Value=""/>
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock4" runat="server">
                                        <script type="text/javascript">
                                            function MenuTypeIdIndexChanged(sender, args) {
                                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                tableView.filter("MenuTypeId", args.get_item().get_value(), "EqualTo");
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>
                                      </FilterTemplate>
                            </telerik:GridDropDownColumn>
                            <telerik:GridDropDownColumn DataField="TypeModuleId" DataSourceID="sdsTypeModule" HeaderText="Módulo" ListTextField="Name" ListValueField="TypeModuleId" UniqueName="TypeModuleId" HeaderStyle-Width-="120px">
                                  <FilterTemplate>
                                    <telerik:RadComboBox ID="cmbTypeModule" DataSourceID="sdsTypeModule" DataTextField="Name" DataValueField="TypeModuleId"  Width="100px"
                                        AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("TypeModuleId").CurrentFilterValue %>'
                                        runat="server" OnClientSelectedIndexChanged="TypeModuleIdIndexChanged" Sort="Ascending">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="Todos" Value=""/>
                                        </Items>
                                    </telerik:RadComboBox>
                                    <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                                        <script type="text/javascript">
                                            function TypeModuleIdIndexChanged(sender, args) {
                                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                tableView.filter("TypeModuleId", args.get_item().get_value(), "EqualTo");
                                            }
                                        </script>
                                    </telerik:RadScriptBlock>
                                      </FilterTemplate>
                            </telerik:GridDropDownColumn>
                        </Columns>

                        <EditFormSettings>
                            <EditColumn InsertText="Agregar" UpdateText="Actualizar" CancelText="Cancelar" ButtonType="ImageButton"></EditColumn>

                            <PopUpSettings Modal="True"></PopUpSettings>
                        </EditFormSettings>

                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    </MasterTableView>

                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    <ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true">
                        <Selecting AllowRowSelect ="true" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
                        </Scrolling>
                        <Selecting AllowRowSelect="True"></Selecting>
                        <ClientEvents OnPopUpShowing="PopUpShowing" />
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                </telerik:RadGrid>
        
            </telerik:RadPageView>
            </telerik:RadMultiPage> 

            <asp:SqlDataSource ID="sdsMenuType" SelectCommandType="StoredProcedure" SelectCommand="MenuTypes_Get_List" runat="server"></asp:SqlDataSource>
            <asp:SqlDataSource ID="sdsTypeModule" SelectCommandType="StoredProcedure" SelectCommand="TypeModules_Get_List" runat="server"></asp:SqlDataSource>
            
        </form>
    </body>
</html>